Added Thrift libraries.

and some arbitrary fixes.