Fixed all the Open issues except the NaN problem

Lots of little fixes.