Fixed errors, added login refresh.