fixes for 7dd6fb1f22be656b4affea5acbb52bc1c13c7906