Fix to multiple tags not necessarily having the right context. Close #515