smal bug fixes