Fixed incorrect IF processing