fix handling of variable types