Major cleanup of old patches and fixing what the last commit broke