lint/style cleanup after pull requests. also fix memory leak