More debugging help and a small speed optimization.