add -Wextra flag and fix issues

addressing https://github.com/mikedlowis/afm/issues/3