Some fixes, optimal boundary still not working