Added streaming support and an error logger.