Restored some not-dead code I accidentially removed before. Closes #257