Fixed more if bugs