Fix some bugs getting from tape to CSR