don't reset pseudo vars in nested loops
fix #247
fix a checkstyle error