Removed debug stubs and unused local functions