Changes to afp.conf and replacing echo with printf.
Hardening and bugfixes.