fixed issue #515 and added test case for same
fixed typos in test case
[fix issue 515] fixed PEP8 error
Merge pull request #525 from AnishShah/iss515

fixed issue #515 and added test case for same