Fix decompression.

Existing code was relying on undefined behaviour of NSData (and, more practically, was not working for me).

I've replaced it with code that works, and (a nice side effect) is more symmetric with the compression code.