Fix usage of deprecated methods