Fixed missing includes.
Reverted previous replacements, not to be done for tests.
Fixed compiler warnings.