Login and minor fixes