Changed ' to " in last sed, so variables get dereferenced.