Squashed a HUGE bug and some other smaller bugs