Bugfix: Fixed #16
And a little cleanup