Last_online fix and some code cleanup
Merge pull request #56 from km4054/master

Last_online fix and some code cleanup