core: Remove a redundant assignment
core: Fix a potential NULL pointer dereference