corrected size macros, renamed mask_upper to more descriptive keep_lower