Upgraded depracated function calls.