JavaScript Fixes and 404 page

* Fixes to scripts, prevent errors on pages without search or sticky elements
* Adds 404 page