Fixed some bugs...

More needed to be fixed.