Try and improve login time by batching db transactions
Fixed issues with login optimisation causing crashing
Fixed asserts causing exit due to gtest