Fix decode to actually decode instead of encode.