bugfix for zero-length keys