improved existing pubfile / nonexisting secfile warning
minor optimizations
only merge metadata if loaded metadata has keys