Fixed problem with downsampling