Actually correct locking and more verbose flags