Build library, plus some syntax fixes