Fixed issues with callback function being rebound correctly