Cleanup debug info, fix frequency bugs