Stats Related Fixes

https://wso2.org/jira/browse/APPM-222