Fixed a bunch of minor errors