Fixed filtering by flags. Removes ssh command