fix some errors and include tiff stacking