Added improvements which allow the examples to run again outside an RCP environment.