Updated the resource management of the engine. Also corrected the
includes.