Fixed typo with Python sorting