Fix bug with pinned magnetisation in flux element residuals