Replaced deprecated calls in lib