Added support for slices. Needs more testing.