Updated users module, database tables and logging of errors