Fixed some warnings and errors

Replace some deprecated properties or methods, and fixed the hash error