Fixed casting
Restored loggers usage