Fixing null handling