Properly decode last frame

This change allows the code to decode all frames.