Fixed a few bugs (Part 1)