fix test, sed expression and cleanup