Fixed an issue in parsing while loops