Some fixes for substates