fix some minor stability issues