Fixing some bugs to make this compile on 2.10.0