Fix compile and warinings