Clean up warning and add a test.