Add libraries, some fixes