The only way to tell the difference between barn and barn is context. Barn means 'child' and 'children.'
The 'the' forms give additional information, however. 'The child' is barnet, where 'the children' is barnen. This is a very common 'conjugation' in Swedish. CF 'brev'. Letter and letters are both brev. However, the letter and the letters are brevet and breven.
Dig and er are the object forms of the pronouns you listed. Du/dig is the singular second person pronoun (you singular) and ni/er is the second person plural (you plural). For example, "Jag älskar er" means "I love you (plural)" and "Jag älskar dig" means "I love you (singular)."
There's two "you"s in swedish that we don't have in english, a singular Du and plural Ni, so if you want to denote plural you in english sometimes people say "You all, you guys, you both, yous, etc" depending on where you're from and what you've grown up around. Some people just leave it up to context to figure it out, though. So it is technically correct.