some fixes to get it working