Fixed some bugs where the value didn't exist, but still got added to the
database