Fixed state machine on 404 keys (2nd request), and improved handling during newline counting (search only currently)