Changed location of output lock.