Fixed a bug in current computation