fix edge behavior in previous() method
Rewrite metadata stuff & misc. fixes