Various bug fixes. Added logging to both packages