Upgraded deprecated function calls.