Clean up master document stuff