Added missing #include - bug #2141.
Applied patch from bug #2154.
Fix for bug #2161