Rewritten from tests

This should be a much better bug ;-)