merged PR from @endoplasmic (thanks!)