Fixed tests for new API.

Closed #1.