Updated checks after comments from @metlos.