Improved cast and instanceof methods in Predef