Fix issue where value of 'opts' wasn't checked