Fix some lifetime bugs
Clean up