Fixes 1136; Reopened from 1175 with latest changes.