Fixed debugging code