Fixed While statement issues