Adjusted argument passing from zend
Added test cases