fix compilation under mac
fix NPE when environment is not initialized at startup
fix for mac: shortcut def and options settings