Fix broken if block