Shared: Moved import of toChunks outside of conditional.

Closes #1590.