Changes from @alexcp (a64c44e11c732a21962e0d70358fa4df0be808c0)