Added example and fixed some minor callback bugs