Fix build under GHC 7.7

See ghc commit 10f83429ba493699af95cb8c3b16d179d78b7749 and issue 8053.