several fixes in x-end