A bit of clean up and comments

I also added a couple of test that make tern fail