Fix io and mkl bugs