Questions about melatonin

Hey there. Recently I have begun taking melatonin a half hour before bed to help me get to sleep at night. It's working well, but I have two questions that I hope someone will be able to answer.

1.) Can you build up a tolerance or dependency to melatonin? I suspect not, due to the fact that it is naturally produced by the pineal gland of the brain, but I thought I'd ask all the same.

2.) I felt a bit groggy when I woke up. Perhaps I should have bought the 3 mg dose instead of the 5 mg. What do you guys think?

Thanks for your time, in advance!