Fixed a bunch of issues.