Merge "Release lock before return" into main