Handle 0x0, 0xn, and nx0 empty/null special cases

Thanks @wasade for catching this!