Corrected InstanceToScreen and ScreenToInstance functions