Added obsnum fixing function