Added some tests + some fixes (found testing)