Fix some deprecated function warnings