Fix compile/logic error