Metadata builder started and some bug fixes