Fix typos and stupid code errors to make profiles work.