fix callback incompatibility issues with Matlab 2014b.