Fixed both hydrohalogenate functions, added more checks for whether things
returned by functions are lists.