Fix and reorganize build properties to work properly