Cleanup

Add clock callback
Remove debug message

lol
Debug functions cleanup
Further debug function cleanup
Fix callbacks, flag preservation