bug fixes & misc