Fix build with gcc (-Wcast-qual)