ref debug tweaks