fixed g++ complaints bugs