Fix error calculating point inside bounds