Fix login related crashes