Fix encode/decode errors and PUTs past logical array size