Fixed conditional bug