misc fixes, still weird behaviour under particular circumstances