Changed callback system. Added stream initialization.