Reworked metadata db update. (#20)