Convert output raster data to integer before saving to file. Further code cleanup
Signed-off-by:Arie <arieclaassens@gmail.com>