made a few fixes to run on ubuntu 13.04