Fixed cmake problems and a fault mentiond in the issues