MInor bug fixes