Fixed use of deprecated methods.