Improved lockfile generation