Print error location and fix infinite loop