some fixes, clean up etc