Some tweaks for better support for custom amservice example