Lockfile and timeout fixes