Added directive test & fixed compare bug