Fixed the DEM parsing error at the wrong spot. Should be working now.