1) Fixed error in timestamp write, when a calling self.write recursively
2) write_terminal now replaces '\r' by ''