Whitespaces in strings were interpreted by the shell as new words. Escaping them ensures the shell sees the string as a single value.
The previous 'localhost' value was causing connection problems on the remote host, such that it would not create a connection through the tunnel to the specified port.