[FIX] Fixed a few small bugs.