some changes to make gcc34 happy