Fixed syntax error and honours SED variable

Change-Id: I8f07f92d171ced7f01926f4d953f7a2313412d8a