some small fixes to make it work