Use our own version of gatherFrom to work around GHC bug 8623