Fixed some bugs in cloud-config