Added support for slice. Fixes #1