Missed portion of the fix for CLOUDSTACK-595 submitted by commit
3ffbc4320abc9fd03ad3abd1f8077cc8d8f9ed4c which caused build break.

Fixing the build break and added missing code.