Made changes to make it build under beta 4