Fixed some possible errors