Improve cross-shell compatibility