Fixed affsd's bugs

(imho better than @WhiteHalmos's fix)