Fix a couple of bugs in the profiles model.