Adds more checks for null