Fixed login and added support for options