manual insertion of PR #354 from @TheVikingWarrior