fix for bug when chosen variation is == 0

more elegant patch than previous one. please review