[Core] Fix some warnings in -Asserts builds.