Fixed csv bug and stm export bug