Fixed bug in if() logic D: