backport recent changes to Scala 2.10

@edani is this is correct in 2.10 or should we go back to the exception catching madness?