Fix bug in get_pos() for negative positions