Some compile fixes for gcc compiler