Fix dialyzer warning for returned types