wide ranging fixes