Convert == to === and added some null checking wrappers

Signed-off-by: Jeremy Ho <jujaga@gmail.com>