Add fixes to prevent array_chunk from complaining