Fixing logical error in render logic.