Fix bugs, some warning but compilation ok