Resolved some bugs for distributed environments.