Slight logic cleanup/corrections