fixes problems in compiling on ubuntu12.04