more fixes to spaces and invalid characters!