Fixed and simplified `subst` method