Cleanup variable names and locks