Fix compilation and warnings with nim 0.10