more bug fixes with help of Ben