more dev to $DATABASE fixes