Hacks to get things working - need to cleanup!