I do not see how this is a problem. Your code can check for these cases and do the appropriate amount of splitting.