fix handling of opacity