Multiple fixes

https://github.com/WindowsAzure/azure-sdk-tools-xplat/issues/653
https://github.com/WindowsAzure/azure-sdk-tools-xplat/issues/526
https://github.com/WindowsAzure/azure-sdk-tools-xplat/issues/528
https://github.com/WindowsAzure/azure-sdk-tools-xplat/issues/565