Some minor change to avoid fork bomb + added more test