Fixed a conditional check and cleaned up logging