Fixed some possible Bugs.