Minor changes to fix some exceptions.