Added null protection.