Fix code when function is used for error handling.
Silent compiler warnings.
Update includes (according to IWYU).