Fix keyword dumping and restoring