[No review] Fix memory leak/have more consistent style