Bug fixes to the code
Merge branch 'mdm-dev' of github.com:WSO2Mobile/mdm into mdm-dev