more little bug fixes and stuff