More tests + fix performance issue