[BUGFIX] Ensure valid arguments for array_chunk

Fixes #637
Possible division by zero.