metadata editor bug fixes

#327, #326 and a few other fixes