further bug fixes