Dang it. Problem 2 worked when i hard-coded the filename.

Why doesn't using the ref filename work?
Finally figured out problem 2. I was stupidly opening the tweet file twice.