make sure opts is defined in createResult

It seems to always be defined, but let's make sure anyway.