GCC errors and warning fixes