Fixed bug when deleting a profile.