more error handling fixes

stderr and % for python 3