Fix backend selection logic