Fixed compile error; possible runtime error