fixing several bugs

it is shameful, that sample modules do not work