Fixed bug where afm-check did not check for '*', added test file, and cleaned up implementation