Fixed 'str' var leaking into global namespace