Changed deprecated methods and replaced broken pieces (untested)