Modified to better work with Foundation 5.