initial work on #110
final fix for #1104