fixed some slicing errors