Fix stop command
Don't rewrite entries unless necessary (fixes #55)