Implement preserve input option. Closes #164.