Added exceptions for open() and close() methods (issue #8)