fix test linking issues found in Ubuntu 14.04
fix test compilation warnings with old gcc