Fix the build for 2.11

Using @adriaanm's commits, this should fix the build for Scala master (and fix all the failed PR builds once merged).