Defensive programming, more tests