lib: fix split and spill