misc changes/cleanup/ bug fixes