Fixed `sed' errors

Also:
- Quote variables to properly handle spaces in values
Merge pull request #2 from eguaj/master

Fixed `sed' errors