Fixes #57; note that issue #41 is reverted