fixed compile warnings

Updated to use new (un-deprecated) methods