Fixed some random bugs.