Fixed lastUserId for postgres to accept sequence name.  also fixed redirect after register.