Fixes #4954 - Fixing several problems in the sync plan API

This also fixes http://projects.theforeman.org/issues/4954