bug fixes and debug view