Added better checks for getting data.

Made some things safer.