some more bug fixes