Avoiding not required temporary variable creation
Removing "None" where 0 is to be used in Lock()
Replacing iterative str lookup with set lookup
Merge pull request #50 from aleksa/master

Minor performance changes