Above you return 0, here you return undef. Are they both the same failure, and if so they should be standardized, or are these unique failure cases?