Fixes for issue 8