fixed part of negative indices problem, added json settings file support