Fixed error message highlighting bugs in Python