Fix overlapping slices

This is a fix to issue #640. I overlooked the fact that sub slices can overlap other slices in my earlier code. The fix is to recursively check if sub slices can fit in the rows below the parent.