Some bug fixes, etc.