Adds Ag plugin and fixes plugin loading.