Added control character removal functionality