Closes #159. Closes #171.