Fixed recursive foreverness. Added Test Case