Fixes #305 while keeping #277 intact
Merge pull request #2 from nholmgaard/master

Fixes #305 while keeping #277 intact