Fix some bugs for BLAS conversion