Fixed registration code and made adding a user check if the username already existed to prevent accounts being overwritten (user if notified if the username is taken).