Changes to any to prevent the const version of cast signalling memory errors via valgrind.