Added checks for data range values in writeBdf