Fixed some possible issues