add tests for expected errors and behavior when closing - closes #60, refs #47