Fix unittest errors