Resolving new merge conflicts between #1844 and master.

Resolved conflicts with Mode. This also represents my lgtm of #1844, so I will merge after the tests pass.