Fixing sed problems