Some bug fixes and tests added
Merge pull request #1 from tipitnet/fixes_and_test_added

Some bug fixes and tests added