Fixed warnings in test compilation.

This commit fixes two problems: a redundant import, and a
deprecated function.