minor bug fixes, work in progress