Fix text mode error