minor adjustments to fix bugs