Fixed slicing error
updated tests and samples