Result calculation bugfix