Bug fixes and unique username constraint