some bug fixes, changes