Your first problem sounds like your project may be corrupted (or the file that you are pasting from). I suggest building a small sample project to see if you can replicate this error. (I could not replicate it.)
As for the second problem, when the Deadline is NA, Project is substituting a default value of the largest unsigned 32-bit integer (2^32-1). To avoid this unintended value, use an If statement in your formula to return your own value in case Deadline is NA.