Fix library compile problems