fixed bug in OSX with g++ 4.2.1