Get rid of a few Ruby warnings

Fixes issue 8027
Fixes issue 8028