Fixed -Wcast-qual gcc warnings