Fix problem with the "when*" family of methods and test them.