Fixed deprecated function calls