More stringent error tracking for bad projs

Sometimes projects get orphaned in the db, hopefully this
fixes the server from crashing.