#257, #255, some small fixes