Fixed some possible bugs.