Squashed version of #9515.
Fixes #9512
Closes #9515

@shoyer if I am merging someone's and it just needs squashing I do it on the command line
merge to master and push directly 
I normally don't created another pr (but if this works for u then ok)
 @jreback K, I'll do that next time. Thanks
