Fix gnu build errors