fixed double application of sed expressions without trailing slashes