some small fixes
Add debugging code to uncover server side errors