bug fixes & performance improvements