Fixed if-else blocks