Correctly deal with errors reported by scala 2.11 compiler

This fixes #421.