[smart] Fix a bug when variables is None (I did not understand why it appears now)