fix all manners of brokenness from nulls and empty strings