fixes #277 #349
Merge pull request #358 from kevinpapst/fixes/349

Fixes #277 #349