wrong function type declarations, and wrong argument type declarations.
converted them into .Fn macros where appropriate. Also fixed up some minor formatting problems.