fixed issue #46 in this commit, i think, and i hope didn't add any new bugs!