bug #664 - fix lock
Merge pull request #9 from rgatkowski/bug_664_fixes

bug #664 - fix lock