Fixed some problems with the JSON loading.

Signed-off-by: Alexander Peev <peev.alexander@gmail.com>