Bug fixes.

Program running now works somewhat.