Add test for catching pointer references