open method simplification

Input checks, code simplification.
Bug fix.