Fixing some bugs and handling map and reduce errors on followers
Merging with fixes on master