Added some tests + bug fixes + groups.