some minor fixed brought in from another project