Realized that Python's ternary operator is different, fixed it.