Fixed weird slice code bug