Fixing NullPointerException in copyData if data is null, refs #1