Commiting half of objective code so I can pick up later without risk.
Also fixes a few minor bugs.