compilation fixes to support gcc 4.1