Fixed bug in logging that prevented messages from being logged properly, and got application lock files working properly.