Updated metadata code and documentation.