Fixed bug where registration saved incorrect id for profiles table entry.