issue #1,#4 - merge fix, tests by Michael Spitzer, Stefan Jaindl