remove debugging and fix bug in uid consistency checking