Critical logic error fix.