Added console messages for debugging.