Fix up warnings for dead code and null access in Platform-core