staticize two functions, and use proper format for a struct sglist
(reported by bz)