Created tests for the issue
Bug fix