Minor bug fixes / clean up
merge last update from Bart fix