Made a number of changes to make slicing more robust. More work does need to be done on this however.