Fixed lock logic, removed ByteBuffer