Use sed -e instead of -E

Simplify regex, not replacing trailing colon (:), fixes #411

~~But this could result in double colons or trailing colons at the end of the PATH..~~ 
Now using multiple `sed` calls as a fix. Should probably be refactored.