Add invalid character replacement

This fixes the bug seen here:
http://pastebin.com/QzWQQndK

Which would generate an Argument Error causing "vagrant up" and other such commands to fail.