Some fixes for Foundation 4