Reverted workaround for GHC Trac 7898, updated code.