Many fixes for my latest commit

Corrected a bunch of errors Wyvvern found.