Remove warnings [Fixes #869]
Ensure lines are integers before using them as strings [Fixes #872]

The problem was that they could be Rational's if the mathn library was
required.
check for directory? in WeirdMethodLocator#valid_file? prevents crash under jruby
Merge pull request #873 from pritchie/master

check for directory? in WeirdMethodLocator#valid_file?