fix byte array sliced access and added testcase