F# collect bug fix + refactoring