Bug fix in slice creation