Fixes towards issue #17