refact
some fixes and upgrades
Merge pull request #1 from Cepnoy/master

some fixes and upgrades