fix a tiny bug in substrate solver