fixes for http://bugs.jython.org/issue1327 and http://bugs.jython.org/issue1746