Add an OS check to the space replace hack