Tests + fixes from tests