some fixes from fluhmann project