Fix for flate decode. Thanks Chris Wakelin