Fix assertions in python 2.6