Firs tof possibly many fixes for compiling with 6cc47 on raspi.