Misc. improvements, overlay code tool function