fixed 'iw scan' exception handling and cleaned up