fix #2594: we were erroneously applying masks, as the reporter suggested