Fixes to UI response writing