Fixed memory leak and clearer includes.