Added statement cache
Added test cases and nil check
Merge