added second parameter to zap_gremlins function to allow a replacement value