Fixed generation of .pid file based on instance.id