Removing some debug code (and changing elseif a little)