bug fixes + clean-ups