fix keys problem for Cloud.pm, minor tests and debug statement fixes