bug fixes & improvements