Use an explicit cast when need a bool from optional<...>. 

The implicit cast was previously allowed, but newer versions of BOOST together with C++11 mark
the cast as 'explicit', and it fails in the current context.