Fix runtime error in mkopt