Fixed debugging code
Fixed compiler errors