Added capability to use standard login. Fixed some bugs