Debug lattice errors on diagnostic function.

Signed-off-by: Luis Lau <luis.laum@gmail.com>