Fixes #30
Fixes #11
Merge pull request #36 from OlofFredriksson/master

Some fixes