Linux fixes for core library and examples/template