Fix a Null value bug and negative range step bug