fix metadata edge-cases. fixes #69 and maxogden/torrent#15
fix tests