fix building on ubuntu

fix two issues that cause the build to fail on ubuntu with gcc 4.8.1