Add tests for trac #5486 and #5681.

Authored by dterei on Dec 6 2011, 1:17 AM.