Some code refactoring has been done.
Some code have been improved.
OS-level file locks have been added.