some changes recommended by Caridy
Plus fixes for end hook points