Reenabled optimizations, added new exception handlings to selection