Fix slicing math

Signed-off-by: Cody Massin <keyosk@gmail.com>