fixed optimization check
Merge branch 'master' into nook