Fix bad lock
spaces/indent
unused preprocessor directive
more locks for devices