Fixed cloud initialization & several NPE issues.