Bug 860731 - Part e: Additional cleanup and fixes; r=bent