Merge request for my branch (Yosh fuckups)

I believe I found a bug Daniel (relating to issue #5, change a5a0e9f ) , and also did some tidying (I'm super bored).