Register user (and some bugfixes)