Fix #47: variant inputs

This fixes #47 and depends on #45.