Changed callback system, fixed bugs