Fix wrong condition compare & remove redundant stream type checking