Fixed bug and refined profile validation