P037: minor improvements, simplified check