fix jruby timeout issues for #16
merged similar contract validation code for #16