Fixes for issue #23