fix bad reference when referenced value doesnot exist.
added incomplete draft of table legend.