Fix __nonzero__ behaviour in Python3+