Comitting various changes and fixes.
Fixing javascript functions.