bug fixes and wip on variant handling

bug fixes