Add --commit/--rollback options
Fix apply: input -> INPUT
Mask: check for valid mask
Fix commit/rollback behavior