Fixes for API changes to make it work in Intellij IDEA 12.