More bst updates

Some code formating(the reason that the diff is so big) and a commit to fix typos and, especially, issue #115. I have to admit that the bst is totally a mass and I spend a whole day to figure out where the problem is... I think we need to re-write the bst in some proper time.

@JosephPeng , plz test this merge request on you side. It seems to work like a charm on my box. I hope it will work for you as well.