Should use instanceof instead of !== null.