Bugfix. Closes #177. Closes #175.