Added proper logging, fixes #4