Login extreme cases fixed