Fixes #4810

Can't believe I didn't pull this earlier.