Added null values checks.