Add return so it don't mess debug output
fix external linkage problem
Remove non used stuff