Fix for issue #23, function callbacks