Fixed explicit cast and slightly improved logging

Signed-off-by: Irmo van den Berge <bergerkiller@gmail.com>
Merge pull request #2184 from bergerkiller/master

Fixed explicit cast and slightly improved logging