Refactoring mar77i's changes

We don't need the path-building-variables any more and don't need execute-permissions on the lock-directory.
The last block contained a superfluous return-statement. This will make it easier for the compiler.