Fix minor issues + Add tests

All are in the title :kiss: