hack to fix building on ghc-7.8.1-rc2 (closes #402 and #401)