Fix errors of data disappearance and wrong base amount calculation