Fix bug in setOptions method