Updated to not override depreceated methods.

Got rid of the deprecation warnings.