Bugfixes/jbau/ami and sync hooks

simple bugfixes for AMI and sync_hooks