Fix bug with newlines causing server to hang
Ensure server doesn't hang if error occurs generating resume