Changes for compiling as library