Fixes for registration class SQL