fix test failures on Nashorn