incorporate deprecation fixes from totaltrash