Fixed couple of bugs in power_spec and changed logic on lum_func mask