Extended parser tests

Also corrected one error with while loops