attempts at bug fixes.