Minor fixes

This is the version which was used (with minor manual debug edits on relink part) to port all issues from the different cmangos repos to cmangos/issues