Fix bug where labels were linked to wrong form elements