Fixes inverted slicing check

Fixes inverted logic in slicing code.