bug fix in homo error computation