Added unit tests for mask_stack, fixed typos as per usual