gradle upgrades and some cleanups and better error handling