Fixed a few minor bugs that caused everything to not work.