Refactor to not use $- variable.

$- is a syntax error in Ruby 2.1+.