equity calculation bugfix