moar sane, fix some issues pointed out in comments