Fixed some debug issues