Remove debug prints, add safety check before memset