Removed redundant stuff.
Fixed a few javascript errors.