Fix bug in structure decoder: used wrong method to slice a buffer.