Removed dangerous function pointer cast