subsequent fix to python for handling small edge cases