Fix hostinterface revised

As per the discussion on pull_request #13, here we re committing the fixes for compilation errors in hostinterface library with modification suggested.