Fixed Ruby warnings.

Fixed tests and code so Ruby warnings disappear.