more fixes, similar to #39