Dead code removal, include optimization/fixing