Updated. Suggestions as to a good test case for this would be appreciated. :)