Manual merge changes. Closes #352