Fix use of deprecated methods