More testing fixes and debug cleanup