Fixes a multitude of issues.