fixed most of the warnings from gcc4.7