Minor server code cleanup and debugging