Fix vars setting, cleaned up old jquery code.