Fixed computeLuminance