Fixed tests and implementation to match new interface