fixes to make tests pass on linux (linker ordering and return vals)