Fix build warnings

fixes #6488