more fixes to invalid characters