fixed bug for deferred tests
added more test cases