Two bug fixes