Fixed loads of bugs
Merge pull request #5 from AlexShumov/master

Fixed loads of bugs