Fixed and tested loginAccount stored proc.

Fixed errors in the loginAccount stored procedure.