Update SM path patch to be more generic

Testing patch before proposing for upstream SM