Fixed the bug of ignoring shell.replace return value.

Got tripped up on this by error-prone (https://code.google.com/p/error-prone/wiki/ReturnValueIgnored)