More fixes for new glue API
Remove unused code