Porting Hugo's fix 98f3abb83a to native compiler.