Fix wrong endmask.