Fixing use of deprecated methods

The warnings were annoying me :)