More robust patsubst