Fixed a multitude of issues.