Making Freeplane library work in headless mode

Hi,

As we discussed here:
http://freeplane-developer.996965.n3.nabble.com/Working-w-o-GUI-for-Flower-Platform-integration-td344.html

I've made some little modifications in your code so that it can run in headless mode without any exceptions thrown.