fixes after review from @DeepDiver1975