Better handling of exists() and unique()

Signed-off-by: Fadion Dashi <jonidashi@gmail.com>