Fix some bugs :).
Merge pull request #441 from alexbegt/1.7

Fixing some bugs, I'll work on more tomorrow :)