Fix build errors with GNU compiler