Set command line runner for Cocaine if we're using JRuby.  Handle more general exception in spec.  Adjust code for math oddity under JRuby.