Fix Scm engine switching logic