Fix exception handling and remove debug output
Write new file to a temporary and move it afterwards.
alfred: Retrieve aliases from alfred

This patch needs tcatm's patched alfred version, otherwise
the format option is not available.