Javascript is weird about nulls