fixes bugs when database is empty and no instance or scenario is initialized
fixes bugs when database is empty and no instance or scenario is initialized

bptlab/JEngine,bptlab/JEngine,bptlab/JEngine,BP2014W1/JEngine,BP2014W1/JEngine,bptlab/JEngine,BP2014W1/JEngine,BP2014W1/JEngine