Fixing exceptions from chai. Adding comments to what the fixes were and why.