improve OPT handling, presumably fixes #875