bug fixes. closing works properly now. #78.