Fixes; changes to decrease number of unnecessary updates to database