More logic error fixes