Fixed some errors that showed up after testing.