Tried adding unit tests to diagnose the problem but to no avail