Fix one bug + fix tests