Fixed a bunch of 'best of' errors and cleaned up JS.