Fixed a few bugs; preparing to get server working.