fix memory decode error

ref #129