Fixed unpacker code