Bugfixes in 404 handler

In the last months, we have made several improvements in the 404 handler.

For more information visit Geta's blog.