Bugfix

Just fixing a few bugs I was lazy enough to overlook.