fix nil potential out-of-bounds error in client/merklemap; overhaul