Fixed a problem with z axis math.
Fixed a problem with opening a new file after a file was opened.