Fixed bug in setting metas
Added some more tests