Fix [-Wignored-qualifiers] and [-Wpedantic] warnings.