Fix for missing include that vs studio forgot to complain about
fix for deconstructor
fixes for linux tmp reference
fix for wrong referncing
fix for linux error
Merge pull request #519 from J-N/develop

Merging in these changes as they look good.