Fixes for issue 27