mainly fixes for issue 7