I have found the answer.
I am using Matlab R2012b. There is a bug in the code that switches the arguments old and new if subs(s,old,new) returns s. It is therefore necessary to give the input subs(s,old,new,0) instead of subs(s,old,new) in order to prevent this from happening.
This has been fixed in Matlab R2013b, which will no longer accept the subs(s,old,new,0) syntax. However, it is imperative to specify this in previous version or the function will switch the old and new as it pleases.
Relevant part of the subs description:
"subs(s,old,new,0) will not accept 0 in a future release. Use subs(s,old,new) instead.
In previous releases, subs(s,old,new,0) prevented switching the arguments old and new if subs(s,old,new) returned s. The subs function does not switch old and new anymore."