Modified for test cases with proper flow.

Signed-off-by: Sanjay Madnani <http://sanjaymadnani.wordpress.com/>