Some final fixes as part of putting 5.6 into place.
Huge bugfix and cleanup pass following 5.6 release.