Re-commit the safe parts of my 6/9 patch. Still working on fixing the unsafe parts.