@ajit
You are right, 2 different approach are used.
Go to admin/profile_edit.php and find this line:
$identifier = osc_sanitize_username(Params::getParam('s_identifier'));
and replace it with:
$identifier = (osc_sanitizeString(Params::getParam('s_identifier')) <> '' ? osc_sanitizeString(Params::getParam('s_identifier')) : $id);