This is how Python, Perl, etc. work.
If you want to increment a value in a hash, and it hasn't been set yet, scripting languages assume it to be 0. This is extremely convenient for such things. However, there is an assumption about the nature of null being made.