bug fixes / improvements