some bug fixes for lon/lat range and added more checking for invalid files