damn bugs, time for some unit tests