Fixes for material flat modules

Thanks to remarks by Fan on the site, especially
http://stacks.math.columbia.edu/tag/00HD#comment-396