Fixed inconsistent debug behaviour.