Add support for manual mask specification