Changed 'locked' to 'tuningLocked' and fixed code, general cleanup