clena up metadata.rb & fix test