Fixed indenting mishaps, started expanding.

I also added preliminary error handling, nothing too amazing. Also fixed
a few errors i was getting.