Removing unnecessary if, fixes #786