Fix loss functions take2