Fixed a bug with references and space escaping