Some changes to be able to compile using cmake and CMakelists.