Improve logging, make platform-independent ;)