fixed usage of deprecated code, fixed some minor warnings