NPE's and a dupe bug