Cleanup OnClientAuthorized
Add define for debug mode