Fixed a bug that cause parser to fail when using while loops.