Patches for check_afs [sf#1119924] [#566]