Improved CloudWatch metrics retrieval code
Merge remote-tracking branch 'origin/master'