Bug fixes

Fixing bugs reported by the google analytics tools.