Rift: avoid leaks, reformat