Remove debugging printf in tests, remove shadowing in tests, fix error printf