Avoid empty arrays when splitting