Fixes for arithmetic usage with $null and undefined variables

Many operations with $null/undefined variables didn't work. Now they do.

Fixes #290