Aded returnmask option.