correctly internalize slices (fixes #7)