Issue #1: ensure we return the correct return code