Added cleanup of used cache (HACK) + fixed filtering error

Signed-off-by: Oleg Nenashev <nenashev@synopsys.com>