foundation update and small fixes