Escaping spaces in internal files

Seems ok but needs some testing