Many fixes to login modules