Issue #202 bugfixes