Small fixed to get_ep functions

Those are just some small fixes and adjustments which also needs to be in the main repository.