fixed GCC errors and warnings