Some code modifications, first basic tests