Topographically generated internal waves and boundary layer instabilities